/***********************************************************************************
//Example.cpp
//
//A very simple example of how to use the DLList class.
//This program can be easily modified for any datatype, not just integers.
//
//Author: Mark Newcomb Jr.
//License: GNU/GPL v3
*///********************************************************************************


#include "DLList.h"
#include <iostream>

using namespace std;

int main()
{
	
	int howMuch = 0, numIn = 0;
	//make a Node and a DLList of the same type (the node is for output - you don't 
	//technically need it to use the list)
	Node<int> outputNode;
	DLList<int>* MyList = new DLList<int>();
	
	cout<<"\nHow many numbers would you like to put in the list?\n";
	cin>>howMuch;
	
	//some really, really simple stuff to keep it reasonable
	if(howMuch < 0 || howMuch > 100){
	howMuch = 1;
	}
	
	//get the user input
	for(int i=0;i<howMuch;i++)
	{
	cin>>numIn;
	MyList->push_front("NumbersExample",numIn);
	numIn = 0;
	}
	
	cout<<endl<<endl<<"Here is the list:"<<endl;
	
	//the empty function's argument stipulates whether or not
	//to use the list's built in counter as well as another method
	//to determine if the list is empty.  We don't really need the counter here,
	//so it's set to false.
	while(!MyList->empty(false))
	{
		//pop the list to our output node and we're done!
		outputNode = MyList->pop_back();
		cout<<"\tName: "<<outputNode.name<<" and Data: "<<outputNode.data<<endl;
	}
	
	return 0;
}
	
		